
/*! \file arsexecitem.cpp
    \brief This file contains implementation for common data objects for ARS execution model.
    \version 1.0

    This model is build from ARS logs. It has a tree structure. Normally root of this tree is
    ARSExecModel object.
*/

#include "arsexecitem.h"

///////// Class 'ARSDummyObject' implementation ////////////////////////////////////////////////////

ARSDummyObject::ARSDummyObject()
              : QObject()
{
    m_status = None;
    m_isModified = Unknown;
}

bool ARSDummyObject::operator== ( const ARSDummyObject & object ) const
{
    return type() == object.type() && name() == object.name();
}

QString ARSDummyObject::name( bool fullName ) const
{
    Q_UNUSED(fullName)

    return m_name;
}

void ARSDummyObject::setName( const QString & name )
{
    m_name = name;
}

ARSDummyObject * ARSDummyObject::toARSObject( const QVariant & variant )
{
    if(QString(variant.typeName()) == QString("ARSDummyActiveLink*"))
        return variant.value<ARSDummyActiveLink*>();

    if(QString(variant.typeName()) == QString("ARSDummyFilter*"))
        return variant.value<ARSDummyFilter*>();

    if(QString(variant.typeName()) == QString("ARSDummyField*"))
        return variant.value<ARSDummyField*>();

    if(QString(variant.typeName()) == QString("ARSDummyGuide*"))
        return variant.value<ARSDummyGuide*>();

    if(QString(variant.typeName()) == QString("ARSDummyForm*"))
        return variant.value<ARSDummyForm*>();

    return 0;
}

ARSDummyObject::Status ARSDummyObject::status() const
{
    return m_status;
}

void ARSDummyObject::setStatus( ARSDummyObject::Status status )
{
    m_status = status;
}

ARSDummyObject::IsModifiedFlag ARSDummyObject::isModified() const
{
    return m_isModified;
}

void ARSDummyObject::setIsModified( ARSDummyObject::IsModifiedFlag flag )
{
    m_isModified = flag;
}

///////// Class 'ARSDummyField' implementation /////////////////////////////////////////////////////

ARSDummyField::ARSDummyField( ARSDummyForm * parentForm )
             : ARSDummyObject()
{
    m_parentForm = parentForm;
    m_id = -1;
}

ARSObject::Type ARSDummyField::type() const
{
    return ARSObject::Field;
}

int ARSDummyField::id() const
{
    return m_id;
}

void ARSDummyField::setID( int id )
{
    m_id = id;
}

QString ARSDummyField::name( bool fullName ) const
{
    if(fullName)
        return m_parentForm->name() + QChar::Nbsp + m_name;

    return m_name;
}

ARSDummyForm * ARSDummyField::parentForm() const
{
    return m_parentForm;
}

bool ARSDummyField::operator== ( const ARSDummyObject & object ) const
{
    if(!ARSDummyObject::operator==(object))
        return false;

    const ARSDummyField & field = static_cast<const ARSDummyField &>(object);
    if(m_parentForm != field.parentForm())
        return false;

    return true;
}

///////// Class 'ARSDummyForm' implementation //////////////////////////////////////////////////////

ARSDummyForm::ARSDummyForm()
       : ARSDummyObject()
{

}

ARSDummyForm::~ARSDummyForm()
{
    // qDeleteAll(m_fieldList);
}

ARSObject::Type ARSDummyForm::type() const
{
    return ARSObject::Form;
}

const ARSDummyField * ARSDummyForm::field( int id ) const
{
    for(int i = 0; i < m_fieldList.size(); i++)
        if(m_fieldList.at(i)->id() == id)
            return m_fieldList.at(i);

    return 0;
}

const ARSDummyField * ARSDummyForm::field( const QString & name )
{
    for(int i = 0; i < m_fieldList.size(); i++)
        if(m_fieldList.at(i)->name() == name)
            return m_fieldList.at(i);

    return 0;
}

void ARSDummyForm::appendField( const ARSDummyField * field )
{
    m_fieldList.append(field);
}

///////// Class 'ARSDummyActiveLink' implementation ////////////////////////////////////////////////

ARSDummyActiveLink::ARSDummyActiveLink()
                  : ARSDummyObject()
{
    setStatus(Secondary);
}

ARSObject::Type ARSDummyActiveLink::type() const
{
    return ARSObject::ActiveLink;
}

///////// Class 'ARSDummyFilter' implementation ////////////////////////////////////////////////////

ARSDummyFilter::ARSDummyFilter()
              : ARSDummyObject()
{
    setStatus(Secondary);
}

ARSObject::Type ARSDummyFilter::type() const
{
    return ARSObject::Filter;
}
///////// Class 'ARSDummyFilter' implementation ////////////////////////////////////////////////////

ARSDummyGuide::ARSDummyGuide( ARSExecWorkflowObject::ObjectType objectsType )
             : ARSDummyObject()
{
    m_objectsType = objectsType;
}

ARSObject::Type ARSDummyGuide::type() const
{
     return ARSObject::Guide;
}

QString ARSDummyGuide::name( bool fullName ) const
{
    if(fullName)
        return QString::number(m_objectsType) + QChar::Nbsp + m_name;

    return m_name;
}

ARSExecWorkflowObject::ObjectType ARSDummyGuide::objectsType() const
{
    return m_objectsType;
}

bool ARSDummyGuide::operator== ( const ARSDummyObject & object ) const
{
    if(!ARSDummyObject::operator==(object))
        return false;

    const ARSDummyGuide & guide = static_cast<const ARSDummyGuide &>(object);
    if(m_objectsType != guide.objectsType())
        return false;

    return true;
}

///////// Class 'ARSExecItem' implementation ///////////////////////////////////////////////////////

ARSExecItem::ARSExecItem( ARSExecItem * parent )
           : QObject(parent)
{
    m_parent = parent;
    if(parent)
        parent->appendChild(this);
}

ARSExecItem::~ARSExecItem()
{
    qDeleteAll(m_childItems);
}

ARSExecItem * ARSExecItem::parent() const
{
    return m_parent;
}

void ARSExecItem::appendChild( ARSExecItem * item )
{
    m_childItems.append(item);
}

void ARSExecItem::insertChild( int row, ARSExecItem * item )
{
    m_childItems.insert(row, item);
}

bool ARSExecItem::isEmpty() const
{
    return m_childItems.isEmpty();
}

int ARSExecItem::childCount() const
{
    return m_childItems.count();
}

ARSExecItem * ARSExecItem::child( int row ) const
{
    if(row < m_childItems.size() && row >= 0)
        return m_childItems.at(row);

    return 0;
}

bool ARSExecItem::hasChildren() const
{
    return !m_childItems.isEmpty();
}

int ARSExecItem::childRow( const ARSExecItem * item ) const
{
    return m_childItems.indexOf(const_cast<ARSExecItem *>(item));
}

int ARSExecItem::row() const
{
    if(m_parent)
        return m_parent->childRow(this);

    return -1;
}

bool ARSExecItem::isLastChild() const
{
    if(!m_parent)
        return true;

    return row() == m_parent->childCount() - 1;
}

ARSExecItem * ARSExecItem::nextSibling() const
{
    if(!m_parent)
        return 0;

    if(row() < m_parent->childCount())
        return m_parent->child(row() + 1);

    return 0;
}

ARSExecItem * ARSExecItem::nextItem() const
{
    if(hasChildren())
        return child(0);

    if(nextSibling())
        return nextSibling();

    const ARSExecItem * nextItemParent = this;

    while(nextItemParent->parent())
    {
        if(nextItemParent->nextSibling())
            return nextItemParent->nextSibling();

        nextItemParent = nextItemParent->parent();
    }

    return 0;
}

ARSExecItem * ARSExecItem::previousItem() const
{
    if(!m_parent)
        return 0;

    int itemRow = row();

    if(itemRow != 0)
    {
        ARSExecItem * prevItem = m_parent->child(itemRow - 1);
        while(prevItem->hasChildren())
            prevItem = prevItem->child(prevItem->childCount() - 1);

        return prevItem;
    }

    return m_parent;
}

bool ARSExecItem::isParentOf( const ARSExecItem * item ) const
{
    const ARSExecItem * tmpItem = item;
    while(tmpItem)
    {
        if(tmpItem == this)
            return true;

        tmpItem = tmpItem->parent();
    }

    return false;
}

ARSExecItem * ARSExecItem::findParent( ARSExecItem::Types type ) const
{
    ARSExecItem * item = const_cast<ARSExecItem *>(this);

    while(item->parent())
    {
        item = item->parent();

        if(item->type() & type)
            return item;
    }

    return 0;
}

ARSExecItemList ARSExecItem::findChildren( ARSExecItem::Types type ) const
{
    ARSExecItemList resultList;

    foreach(ARSExecItem * item, m_childItems)
    {
        if(item->type() & type)
            resultList.append(item);
        else
            resultList.append(item->findChildren(type));
    }

    return resultList;
}

QString ARSExecItem::comment() const
{
    return m_comment;
}

void ARSExecItem::setComment( const QString & text )
{
    m_comment = text;
}

QTime ARSExecItem::time()
{
    return m_time;
}

void ARSExecItem::setTime( const QTime & time )
{
    m_time = time;
}

ARSExecItem * ARSExecItem::createItemByName(const QString & name, ARSExecItem * parent)
{
    if(name == "ARSExecActl")
            return new ARSExecActl(parent);

    if(name == "ARSExecFltr")
            return new ARSExecFltr(parent);

    if(name == "ARSExecRootItem")
            return new ARSExecRootItem(parent);

    if(name == "ARSExecActlBlock")
            return new ARSExecActlBlock(parent);

    if(name == "ARSExecFltrBlock")
            return new ARSExecFltrBlock(parent);

    if(name == "ARSExecGuide")
            return new ARSExecGuide(parent);

    if(name == "ARSExecActionCallGuide")
            return new ARSExecActionCallGuide(parent);

    if(name == "ARSExecActionChangeFields")
            return new ARSExecActionChangeFields(parent);

    if(name == "ARSExecActionCloseWindow")
            return new ARSExecActionCloseWindow(parent);

    if(name == "ARSExecActionCommitChanges")
            return new ARSExecActionCommitChanges(parent);

    if(name == "ARSExecActionDDE")
            return new ARSExecActionDDE(parent);

    if(name == "ARSExecActionDirectSQL")
            return new ARSExecActionDirectSQL(parent);

    if(name == "ARSExecActionDSOAction")
            return new ARSExecActionDSOAction(parent);

    if(name == "ARSExecActionExitGuide")
            return new ARSExecActionExitGuide(parent);

    if(name == "ARSExecActionGoToGuideLabel")
            return new ARSExecActionGoToGuideLabel(parent);

    if(name == "ARSExecActionGoto")
            return new ARSExecActionGoto(parent);

    if(name == "ARSExecActionLogToFile")
            return new ARSExecActionLogToFile(parent);

    if(name == "ARSExecActionMessage")
            return new ARSExecActionMessage(parent);

    if(name == "ARSExecActionNotify")
            return new ARSExecActionNotify(parent);

    if(name == "ARSExecActionOLEAutomation")
            return new ARSExecActionOLEAutomation(parent);

    if(name == "ARSExecActionOpenWindow")
            return new ARSExecActionOpenWindow(parent);

    if(name == "ARSExecActionRunMacro")
            return new ARSExecActionRunMacro(parent);

    if(name == "ARSExecActionRunProcess")
            return new ARSExecActionRunProcess(parent);

    if(name == "ARSExecActionWait")
            return new ARSExecActionWait(parent);

    if(name == "ARSExecActionPushFields")
            return new ARSExecActionPushFields(parent);

    if(name == "ARSExecActionSetFields")
            return new ARSExecActionSetFields(parent);

    if(name == "ARSExecFieldAssign")
            return new ARSExecFieldAssign(parent);

    if(name == "ARSExecSQLLine")
            return new ARSExecSQLLine(parent);

    if(name == "ARSExecAPILine")
            return new ARSExecAPILine(parent);

    if(name == "ARSExecModelRootItem")
            return new ARSExecModelRootItem();

    qDebug(qPrintable("LogFileAdapter::itemFromName: \"" + name + "\" is not correct"));
    return 0;
}

///////// Class 'ARSExecModelRootItem' implementation //////////////////////////////////////////////

ARSExecModelRootItem::ARSExecModelRootItem()
    : ARSExecItem()
{
}

ARSExecItem::Type ARSExecModelRootItem::type() const
{
    return ItemTypeModelRoot;
}

///////// Class 'ARSExecWorkflowObject' implementation /////////////////////////////////////////////

ARSExecWorkflowObject::ARSExecWorkflowObject( ARSExecItem * parent )
                     : ARSExecItem(parent)
{
    m_execState = StateNone;
    m_executionOrder = -1;
}

ARSExecItem::Type ARSExecWorkflowObject::type() const
{
    return ItemTypeWorkflowObject;
}

ARSExecWorkflowObject::ExecState ARSExecWorkflowObject::execState() const
{
    return m_execState;
}

void ARSExecWorkflowObject::setExecState( ARSExecWorkflowObject::ExecState state )
{
    m_execState = state;
}

int ARSExecWorkflowObject::executionOrder() const
{
    return m_executionOrder;
}

void ARSExecWorkflowObject::setExecutionOrder( int executionOrder )
{
    m_executionOrder = executionOrder;
}

///////// Class 'ARSExecActl' implementation ///////////////////////////////////////////////////////

ARSExecActl::ARSExecActl( ARSExecItem * parent )
           : ARSExecWorkflowObject(parent)
{
    m_activeLink = 0;
}

ARSExecWorkflowObject::ObjectType ARSExecActl::objectType() const
{
    return ActiveLink;
}

ARSDummyActiveLink * ARSExecActl::activeLink() const
{
    return m_activeLink;
}

void ARSExecActl::setActiveLink( ARSDummyActiveLink * activeLink )
{
    m_activeLink = activeLink;
}

///////// Class 'ARSExecFltr' implementation ///////////////////////////////////////////////////////

ARSExecFltr::ARSExecFltr( ARSExecItem * parent )
           : ARSExecWorkflowObject(parent)
{
    m_filter = 0;
}

ARSExecWorkflowObject::ObjectType ARSExecFltr::objectType() const
{
    return Filter;
}

ARSDummyFilter * ARSExecFltr::filter()
{
    return m_filter;
}

void ARSExecFltr::setFilter( ARSDummyFilter * filter )
{
    m_filter = filter;
}


///////// Class 'ARSServerSideItemBase' implementation /////////////////////////////////////////////

ARSServerSideItemBase::ARSServerSideItemBase( ARSExecItem * parent )
                     : ARSExecItem(parent)
{
    m_queue = -1;
}

QString ARSServerSideItemBase::TID() const
{
    return m_TID;
}

void ARSServerSideItemBase::setTID( const QString & TID )
{
    m_TID = TID;
}

QString ARSServerSideItemBase::rpcID() const
{
    return m_rpcID;
}

void ARSServerSideItemBase::setRpcID( const QString & rpcID )
{
    m_rpcID = rpcID;
}

int ARSServerSideItemBase::queue() const
{
    return m_queue;
}

void ARSServerSideItemBase::setQueue( int queue )
{
    m_queue = queue;
}

QString ARSServerSideItemBase::clientRPC() const
{
    return m_clientRPC;
}

void ARSServerSideItemBase::setClientRPC( const QString & clientRPC )
{
    m_clientRPC = clientRPC;
}

QString ARSServerSideItemBase::user() const
{
    return m_user;
}

void ARSServerSideItemBase::setUser( const QString & user )
{
    m_user = user;
}

QDateTime ARSServerSideItemBase::dateTime() const
{
    return m_dateTime;
}

void ARSServerSideItemBase::setDateTime( const QDateTime & dateTime )
{
    m_dateTime = dateTime;
}

///////// Class 'ARSExecRootItem' implementation ///////////////////////////////////////////////////

ARSExecRootItem::ARSExecRootItem( ARSExecItem * parent )
               : ARSExecItem(parent)
{
}

ARSExecItem::Type ARSExecRootItem::type() const
{
    return ItemTypeRoot;
}

QDateTime ARSExecRootItem::createDateTime() const
{
    return m_createDateTime;
}

void ARSExecRootItem::setCreateDateTime( const QDateTime & dateTime )
{
    m_createDateTime = dateTime;
}

QString ARSExecRootItem::userVersion() const
{
    return m_userVersion;
}

void ARSExecRootItem::setUserVersion( const QString & userVersion )
{
    m_userVersion = userVersion;
}

///////// Class 'ARSExecWorkflowBlock' implementation //////////////////////////////////////////////

ARSExecWorkflowBlock::ARSExecWorkflowBlock( ARSExecItem * parent )
                    : ARSExecItem(parent)
{
    m_event = None;
    m_form = 0;
}

ARSExecItem::Type ARSExecWorkflowBlock::type() const
{
    return ItemTypeWorkflowBlock;
}

ARSExecWorkflowBlock::Event ARSExecWorkflowBlock::event() const
{
    return m_event;
}

void ARSExecWorkflowBlock::setEvent( ARSExecWorkflowBlock::Event event )
{
    m_event = event;
}

ARSDummyForm * ARSExecWorkflowBlock::form() const
{
    return m_form;
}

void ARSExecWorkflowBlock::setForm( ARSDummyForm * form )
{
    m_form = form;
}

///////// Class 'ARSExecActlBlock' implementation //////////////////////////////////////////

ARSExecActlBlock::ARSExecActlBlock( ARSExecItem * p )
                : ARSExecWorkflowBlock(p)
{
    m_screenType = ScreenNone;
    m_linkedField = 0;
}

ARSExecWorkflowObject::ObjectType ARSExecActlBlock::objectsType() const
{
    return ARSExecWorkflowObject::ActiveLink;
}

ARSExecActlBlock::ScreenType ARSExecActlBlock::screenType() const
{
    return m_screenType;
}

void ARSExecActlBlock::setScreenType( ARSExecActlBlock::ScreenType screenType )
{
    m_screenType = screenType;
}

ARSDummyField * ARSExecActlBlock::linkedField() const
{
    return m_linkedField;
}

void ARSExecActlBlock::setLinkedField( ARSDummyField * field )
{
    m_linkedField = field;
}

///////// Class 'ARSExecFltrBlock' implementation //////////////////////////////////////////

ARSExecFltrBlock::ARSExecFltrBlock( ARSExecItem * parent )
                : ARSExecWorkflowBlock(parent) //, ARSServerSideItemBase(parent)
{
    m_phase = None;
}

ARSExecWorkflowObject::ObjectType ARSExecFltrBlock::objectsType() const
{
    return ARSExecWorkflowObject::Filter;
}

ARSExecFltrBlock::Phase ARSExecFltrBlock::phase() const
{
    return m_phase;
}

void ARSExecFltrBlock::setPhase( ARSExecFltrBlock::Phase phase )
{
    m_phase = phase;
}

QString ARSExecFltrBlock::requestID() const
{
    return m_requestID;
}

void ARSExecFltrBlock::setRequestID( const QString  & requestID )
{
    m_requestID = requestID;
}

///////// Class 'ARSExecGuide' implementation //////////////////////////////////////////////////////

ARSExecGuide::ARSExecGuide( ARSExecItem * parent )
            : ARSExecItem(parent)
{
    m_objectsType = ARSExecWorkflowObject::Unknown;
}

ARSExecItem::Type ARSExecGuide::type() const
{
    return ItemTypeGuide;
}

ARSExecWorkflowObject::ObjectType ARSExecGuide::objectsType()
{
    return m_objectsType;
}

void ARSExecGuide::setObjectsType( ARSExecWorkflowObject::ObjectType type )
{
    m_objectsType = type;
}

ARSDummyGuide * ARSExecGuide::guide()
{
    return m_guide;
}

void ARSExecGuide::setGuide( ARSDummyGuide * guide )
{
    m_guide = guide;
}

///////// Class 'ARSExecAction' implementation /////////////////////////////////////////////////////

ARSExecAction::ARSExecAction( ARSExecItem * parent )
             : ARSExecItem(parent)
{
    m_adjournedPhase = ARSExecFltrBlock::None;
}

ARSExecItem::Type ARSExecAction::type() const
{
    return ItemTypeAction;
}

ARSExecFltrBlock::Phase ARSExecAction::adjournedPhase()
{
    return m_adjournedPhase;
}

void ARSExecAction::setAdjournedPhase( ARSExecFltrBlock::Phase phase )
{
    m_adjournedPhase = phase;
}

///////// Class 'ARSExecActionCallGuide' implementation ////////////////////////////////////////////

ARSExecActionCallGuide::ARSExecActionCallGuide( ARSExecItem * parent )
                      : ARSExecAction(parent)
{
    m_guide = 0;
}

ARSExecAction::ActionType ARSExecActionCallGuide::actionType() const
{
    return CallGuide;
}

ARSDummyGuide * ARSExecActionCallGuide::guide() const
{
    return m_guide;
}

void ARSExecActionCallGuide::setGuide( ARSDummyGuide * guide )
{
    m_guide = guide;
}

///////// Class 'ARSExecActionChangeFields' implementation /////////////////////////////////////////

ARSExecActionChangeFields::ARSExecActionChangeFields( ARSExecItem * parent )
                         : ARSExecAction(parent)
{
    m_field = 0;

    m_access = AccessUnchanged;
    m_visibility = VisibilityUnchanged;
    m_font = FontUnchanged;
    m_focus = FocusUnchanged;
    m_labelColor = -1;
}


ARSExecAction::ActionType ARSExecActionChangeFields::actionType() const
{
    return ChangeFields;
}


ARSDummyField * ARSExecActionChangeFields::field()
{
    return m_field;
}

void ARSExecActionChangeFields::setField( ARSDummyField * field )
{
    m_field = field;
}

ARSExecActionChangeFields::Access ARSExecActionChangeFields::access() const
{
    return m_access;
}

void ARSExecActionChangeFields::setAccess( ARSExecActionChangeFields::Access access )
{
    m_access = access;
}

ARSExecActionChangeFields::Visibility ARSExecActionChangeFields::visibility() const
{
    return m_visibility;
}

void ARSExecActionChangeFields::setVisibility( ARSExecActionChangeFields::Visibility visibility )
{
    m_visibility = visibility;
}

ARSExecActionChangeFields::Font ARSExecActionChangeFields::font() const
{
    return m_font;
}

void ARSExecActionChangeFields::setFont( ARSExecActionChangeFields::Font font )
{
    m_font = font;
}

ARSExecActionChangeFields::Focus ARSExecActionChangeFields::focus() const
{
    return m_focus;
}

void ARSExecActionChangeFields::setFocus( ARSExecActionChangeFields::Focus focus )
{
    m_focus = focus;
}

int ARSExecActionChangeFields::labelColor() const
{
    return m_labelColor;
}

void ARSExecActionChangeFields::setLabelColor( int labelColor )
{
    m_labelColor = labelColor;
}

QString ARSExecActionChangeFields::label() const
{
    return m_label;
}

void ARSExecActionChangeFields::setLabel( QString label )
{
    m_label = label;
}

///////// Class 'ARSExecActionCloseWindow' implementation //////////////////////////////////////////

ARSExecActionCloseWindow::ARSExecActionCloseWindow( ARSExecItem * parent )
                        : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionCloseWindow::actionType() const
{
    return CloseWindow;
}

///////// Class 'ARSExecActionCommitChanges' implementation ///////////////////////////////////////

ARSExecActionCommitChanges::ARSExecActionCommitChanges( ARSExecItem * parent )
                          : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionCommitChanges::actionType() const
{
    return CommitChanges;
}
////////ARSExecActionDDE/ Class '' implementation /////////////////////////////////////////////////

ARSExecActionDDE::ARSExecActionDDE( ARSExecItem * parent )
                : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionDDE::actionType() const
{
    return DDE;
}

QString ARSExecActionDDE::service()
{
    return m_service;
}

void ARSExecActionDDE::setService( const QString & service )
{
    m_service = service;
}

QString ARSExecActionDDE::topic()
{
    return m_topic;
}

void ARSExecActionDDE::setTopic(  const QString & topic )
{
    m_topic = topic;
}

QString ARSExecActionDDE::item()
{
    return m_item;
}

void ARSExecActionDDE::setItem( const QString & item )
{
    m_item = item;
}

ARSExecActionDDE::DDEAction ARSExecActionDDE::action()
{
    return m_action;
}

void ARSExecActionDDE::setAction( ARSExecActionDDE::DDEAction action )
{
    m_action = action;
}

QString ARSExecActionDDE::path()
{
    return m_path;
}

void ARSExecActionDDE::setPath(  const QString & path  )
{
    m_path = path;
}

QString ARSExecActionDDE::command()
{
    return m_command;
}

void ARSExecActionDDE::setComand( const QString & command )
{
    m_command = command;
}

///////// Class 'ARSExecActionDirectSQL' implementation ///////////////////////////////////////////

ARSExecActionDirectSQL::ARSExecActionDirectSQL( ARSExecItem * parent )
                      : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionDirectSQL::actionType() const
{
    return DirectSQL;
}

QString ARSExecActionDirectSQL::command()
{
    return m_command;
}

void ARSExecActionDirectSQL::setCommand( const QString & command )
{
    m_command = command;
}

///////// Class 'ARSExecActionDSOAction' implementation ///////////////////////////////////////////

ARSExecActionDSOAction::ARSExecActionDSOAction( ARSExecItem * parent )
                      : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionDSOAction::actionType() const
{
    return DSOAction;
}

///////// Class 'ARSExecActionExitGuide' implementation ///////////////////////////////////////////

ARSExecActionExitGuide::ARSExecActionExitGuide( ARSExecItem * parent )
                      : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionExitGuide::actionType() const
{
    return ExitGuide;
}

///////// Class 'ARSExecActionGoToGuideLabel' implementation //////////////////////////////////////

ARSExecActionGoToGuideLabel::ARSExecActionGoToGuideLabel( ARSExecItem * parent )
                           : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionGoToGuideLabel::actionType() const
{
    return GoToGuideLabel;
}

QString ARSExecActionGoToGuideLabel::label() const
{
    return m_label;
}

void ARSExecActionGoToGuideLabel::setLabel( const QString & label )
{
    m_label = label;
}

///////// Class 'ARSExecActionGoto' implementation ////////////////////////////////////////////////

ARSExecActionGoto::ARSExecActionGoto( ARSExecItem * parent )
                 : ARSExecAction(parent)
{
    m_executionOrder = -1;
}

ARSExecAction::ActionType ARSExecActionGoto::actionType() const
{
    return Goto;
}

int ARSExecActionGoto::executionOrder() const
{
    return m_executionOrder;
}

void ARSExecActionGoto::setExecutionOrder( int order )
{
    m_executionOrder = order;
}

///////// Class 'ARSExecActionLogToFile' implementation ///////////////////////////////////////////

ARSExecActionLogToFile::ARSExecActionLogToFile( ARSExecItem * parent )
                      : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionLogToFile::actionType() const
{
    return LogToFile;
}

///////// Class 'ARSExecActionMessage' implementation /////////////////////////////////////////////

ARSExecActionMessage::ARSExecActionMessage( ARSExecItem * parent )
                    : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionMessage::actionType() const
{
    return Message;
}

QString ARSExecActionMessage::text() const
{
    return m_text;
}

void ARSExecActionMessage::setText( const QString & text )
{
    m_text = text;
}

///////// Class 'ARSExecActionNotify' implementation //////////////////////////////////////////////

ARSExecActionNotify::ARSExecActionNotify( ARSExecItem * parent )
                   : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionNotify::actionType() const
{
    return Notify;
}

///////// Class 'ARSExecActionOLEAutomation' implementation ///////////////////////////////////////

ARSExecActionOLEAutomation::ARSExecActionOLEAutomation( ARSExecItem * parent )
                          : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionOLEAutomation::actionType() const
{
    return OLEAutomation;
}

///////// Class 'ARSExecActionOpenWindow' implementation //////////////////////////////////////////

ARSExecActionOpenWindow::ARSExecActionOpenWindow( ARSExecItem * parent )
                       : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionOpenWindow::actionType() const
{
    return OpenWindow;
}

///////// Class 'ARSExecActionRunMacro' implementation ////////////////////////////////////////////

ARSExecActionRunMacro::ARSExecActionRunMacro( ARSExecItem * parent )
                     : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionRunMacro::actionType() const
{
    return RunMacro;
}

///////// Class 'ARSExecActionRunProcess' implementation //////////////////////////////////////////

ARSExecActionRunProcess::ARSExecActionRunProcess( ARSExecItem * parent )
                       : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionRunProcess::actionType() const
{
    return RunProcess;
}

///////// Class 'ARSExecActionWait' implementation ////////////////////////////////////////////////

ARSExecActionWait::ARSExecActionWait( ARSExecItem * parent )
                 : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionWait::actionType() const
{
    return Wait;
}

///////// Class 'ARSExecActionPushFields' implementation //////////////////////////////////////////

ARSExecActionPushFields::ARSExecActionPushFields( ARSExecItem * parent )
                       : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionPushFields::actionType() const
{
    return PushFields;
}

///////// Class 'ARSExecActionSetFields' implementation ///////////////////////////////////////////

ARSExecActionSetFields::ARSExecActionSetFields( ARSExecItem * parent )
                      : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionSetFields::actionType() const
{
    return SetFields;
}

///////// Class 'ARSExecActionSetFields' implementation ///////////////////////////////////////////

ARSExecActionService::ARSExecActionService( ARSExecItem * parent )
                    : ARSExecAction(parent)
{

}

ARSExecAction::ActionType ARSExecActionService::actionType() const
{
    return Service;
}

///////// Class 'ARSExecFieldAssign ' implementation ///////////////////////////////////////////////

ARSExecFieldAssign::ARSExecFieldAssign( ARSExecItem * parent )
                  : ARSExecItem(parent)
{
    m_field = 0;
}

ARSExecItem::Type ARSExecFieldAssign::type() const
{
    return ItemTypeFieldAssign;
}

ARSDummyField * ARSExecFieldAssign::field() const
{
    return m_field;
}

void ARSExecFieldAssign::setField( ARSDummyField * field )
{
    m_field = field;
}

QString ARSExecFieldAssign::value()
{
    return m_value;
}

void ARSExecFieldAssign::setValue( const QString & value )
{
    m_value = value;
}

///////// Class 'ARSExecSQLLine' implementation ////////////////////////////////////////////////////

ARSExecSQLLine::ARSExecSQLLine( ARSExecItem * parent )
    : ARSExecItem(parent)
{

}

ARSExecItem::Type ARSExecSQLLine::type() const
{
    return ItemTypeSQLLine;
}

QString ARSExecSQLLine::text() const
{
    return m_text;
}

void ARSExecSQLLine::setText( const QString & text )
{
    m_text = text;
}

///////// Class 'ARSExecAPILine' implementation ////////////////////////////////////////////////////

ARSExecAPILine::ARSExecAPILine( ARSExecItem * parent )
    : ARSExecItem(parent)
{

}

ARSExecItem::Type ARSExecAPILine::type() const
{
    return ItemTypeAPILine;
}

QString ARSExecAPILine::text() const
{
    return m_text;
}

void ARSExecAPILine::setText( const QString & text )
{
    m_text = text;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
